#ifndef QILISUBTITLEEMOJI_H
#define QILISUBTITLEEMOJI_H

#include <QObject>
#include <QString>
#include <QUuid>
#include <QMutex>
#include <QMap>
#include <functional>

class QiliImageLoader;

class QiliSubtitleEmoji : public QObject
{
    Q_OBJECT

public:
    QiliSubtitleEmoji() = delete;
    static QString load(const QString &url);

private:
    static QMutex  mMutex;
    static QMap<QString, QString> mCaches;

    static bool isCached(const QString &digest);
    static void cache(const QString &digest, const QString &cached, std::function<bool(void)> persister);
};

#endif // QILISUBTITLEEMOJI_H
